<template>
    <h2>注册信息显示</h2>
    <table class="table table-bordered">
        <thead>
            <tr>
                <td>用户名</td>
                <td>用户密码</td>
                <td>注册时间</td>
            </tr>
        </thead>
        <tbody>
            <tr v-for="i in data" :key="i.Uid">
                <td>{{ i.UserName }}</td>
                <td>{{ i.Password.substr(20) + "******" }}</td>
                <td>{{ i.Rtime.substr(0, 19).replace("T", " ") }}</td>
            </tr>
        </tbody>
    </table>
</template>
<script setup lang="ts">
import { onMounted, ref } from 'vue'
import axios from 'axios'
// import { useRouter } from 'vue-router'
// const router = useRouter()
const data: any = ref([])
onMounted(() => {
    show();
})
const show = () => {
    axios.get("http://localhost:51294/api/Tian/ShowLogin")
        .then(res => {
            data.value = res.data
        })
        .catch(erro => {
            console.log(erro);
        })
}
</script>